package org.example.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.example.Bean.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface EmpMapper {
    @Select("select * from emp")
    List<Emp> findAll();
    @Insert("insert into emp values (null,#{ename},#{job},#{mgr},now(),#{sal},#{comm},#{deptNo},1)")
    boolean insert1(Emp emp);
    @Update("update emp set sal=#{sal},comm=#{comm},deptNo=#{deptNo} where empno=#{empNo}")
    boolean update1(Emp emp);
    @Update("update emp set state=0 where empno=#{id}")
    boolean update2(int id);
}
